package com.example.electricbicycle.po;

import java.util.Date;
import  com.example.electricbicycle.po.Vehicle;

public class PurchaseOrder {
    private int id;
    private int user_id;
    private int v_id;
    private int quantity;
    private int status;
    private Date createTime;

    // 关联对象
    private Vehicle vehicle;
    private Salesman salesman;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public int getV_id() {
        return v_id;
    }

    public void setV_id(int v_id) {
        this.v_id = v_id;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Vehicle getVehicle() {
        return vehicle;
    }

    public void setVehicle(Vehicle vehicle) {
        this.vehicle = vehicle;
    }

    public Salesman getSalesman() {
        return salesman;
    }

    public void setSalesman(Salesman salesman) {
        this.salesman = salesman;
    }

    public PurchaseOrder() {
    }

    public PurchaseOrder(int id, Salesman salesman, Vehicle vehicle, Date createTime, int status, int quantity, int v_id, int user_id) {
        this.id = id;
        this.salesman = salesman;
        this.vehicle = vehicle;
        this.createTime = createTime;
        this.status = status;
        this.quantity = quantity;
        this.v_id = v_id;
        this.user_id = user_id;
    }

    public PurchaseOrder(int id, int user_id,  int v_id,int quantity, int status, Date createTime) {
        this.id = id;
        this.createTime = createTime;
        this.quantity = quantity;
        this.status = status;
        this.v_id = v_id;
        this.user_id = user_id;
    }

    public String getStatusText() {
        return status == 0 ? "未审核" : "已审核";
    }
}